home *** CD-ROM | disk | FTP | other *** search
- #define DISABLE_LOCAL_CALLTRACE 1 // Set to 1 to disable Call Traces for this file.
- #define DISABLE_LOCAL_DEBUG 0 // Set to 1 to disable all debugging for this file.
- #include "DebugUtils.h"
-
- #include <LowMem.h>
- #include "ContextUtils.h"
- #include "Nub.h"
- #include "Patches.h"
- #include "PatchHarness.h"
- #include "Port.h"
- #include "ProcInfo.h"
-
- #include "FlushPort.h"
-
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- static pascal void CleanUpApplicationPatch(void);
- static pascal void CloseCPortPatch(CGrafPtr port);
- static pascal void ClosePortPatch(GrafPtr port);
- static pascal void CopyBitsPatch(BitMap *srcBits,BitMap *dstBits,Rect *srcRect,Rect *dstRect,short mode,RgnHandle maskRgn,CopyBitsProcPtr copyBitsProc);
- static pascal void OpenCPortPatch(CGrafPtr port);
- static pascal void OpenPortPatch(GrafPtr port);
- static pascal void SynchIdleTimePatch(void);
-
- #ifdef __cplusplus
- }
- #endif
-
-
-
-
-
- extern NubInfo *gInfo;
- static RoutineDescriptor gCleanUpApplicationPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppCleanUpApplicationPatchProcInfo,CleanUpApplicationPatch);
- static RoutineDescriptor gCloseCPortPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppCloseCPortPatchProcInfo,CloseCPortPatch);
- static RoutineDescriptor gClosePortPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppClosePortPatchProcInfo,ClosePortPatch);
- static RoutineDescriptor gCopyBitsPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppCopyBitsPatchProcInfo,CopyBitsPatch);
- static RoutineDescriptor gOpenCPortPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppOpenCPortPatchProcInfo,OpenCPortPatch);
- static RoutineDescriptor gOpenPortPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppOpenPortPatchProcInfo,OpenPortPatch);
- static RoutineDescriptor gSynchIdleTimePatchRD = BUILD_ROUTINE_DESCRIPTOR(uppSynchIdleTimePatchProcInfo,SynchIdleTimePatch);
-
-
- extern Boolean gOkToBlit = false;
- extern GWorldPtr gScreenBuffer;
-
-
-
- void InitializePatches(void)
- {
- InstallPatch(gInfo->patchList,'CApp',&gCleanUpApplicationPatchRD);
- InstallPatch(gInfo->patchList,'ClCP',&gCloseCPortPatchRD);
- InstallPatch(gInfo->patchList,'CloP',&gClosePortPatchRD);
- InstallPatch(gInfo->patchList,'CBit',&gCopyBitsPatchRD);
- InstallPatch(gInfo->patchList,'OpCP',&gOpenCPortPatchRD);
- InstallPatch(gInfo->patchList,'OpnP',&gOpenPortPatchRD);
- InstallPatch(gInfo->patchList,'IDLE',&gSynchIdleTimePatchRD);
- }
-
-
-
-
-
- void FinalizePatches(void)
- {
- RemovePatch(gInfo->patchList,'IDLE');
- RemovePatch(gInfo->patchList,'OpnP');
- RemovePatch(gInfo->patchList,'OpCP');
- RemovePatch(gInfo->patchList,'CBit');
- RemovePatch(gInfo->patchList,'CloP');
- RemovePatch(gInfo->patchList,'ClCP');
- RemovePatch(gInfo->patchList,'CApp');
- }
-
-
- #if 0
- #pragma mark -
- #endif
-
-
- pascal void CleanUpApplicationPatch(void)
- {
- StSystemZone zone;
- RescanPorts();
- }
-
-
-
-
-
- pascal void CloseCPortPatch(CGrafPtr port)
- {
- StSystemZone zone;
- UnregisterPort((GrafPtr)port,false);
- }
-
-
-
-
-
- pascal void ClosePortPatch(GrafPtr port)
- {
- StSystemZone zone;
- UnregisterPort(port,false);
- }
-
-
-
-
-
- pascal void CopyBitsPatch(BitMap *srcBits,BitMap *dstBits,Rect *srcRect,Rect *dstRect,short mode,RgnHandle maskRgn,CopyBitsProcPtr copyBitsProc)
- {
- MungeCopyBits(srcBits,dstBits,srcRect,dstRect,mode,maskRgn,copyBitsProc);
- }
-
-
-
-
-
- pascal void OpenCPortPatch(CGrafPtr port)
- {
- StSystemZone zone;
- RegisterPort((GrafPtr)port);
- }
-
-
-
-
-
- pascal void OpenPortPatch(GrafPtr port)
- {
- StSystemZone zone;
- RegisterPort(port);
- }
-
-
-
-
-
- pascal void SynchIdleTimePatch(void)
- {
- StSystemZone zone;
- FlushScreenBuffer();
- }
-